---
-- @return
local function isAndroidDevice()
    return system.getInfo( "platformName" ) == "Android";
end
system.isAndroidDevice = isAndroidDevice;

---
-- @return
local function isIOSDevice()
    return system.getInfo("platformName") == "iPhone OS";
end
system.isIOSDevice = isIOSDevice;

---
-- @return
local function isSimulator()
    return system.getInfo("environment") == "simulator";
end
system.isSimulator = isSimulator;

---
-- @return
local function getLanguageCode()
    local locale;
    
    if system.getInfo( "platformName" ) ~= "Android" then
         locale = system.getPreference( "ui", "language" )
    else
         locale = system.getPreference( "locale", "language" )
    end
    locale = string.sub( locale, 1, 2);
    
    if (locale == "de" or locale == "fr" or locale == "en") then
        return locale;
    else
        return "en";
    end
end
system.getLanguageCode = getLanguageCode;
